/******************************************************************************
00002 
00003   Copyright (c) 2007,2010,2011 Turku PET Centre
00004 
00005   File:        csv.h
00006   Library:     csv
00007   Description: I/O functions for CSV files (comma-separated values).
00008 
00009   This library is free software; you can redistribute it and/or
00010   modify it under the terms of the GNU Lesser General Public
00011   License as published by the Free Software Foundation; either
00012   version 2.1 of the License, or (at your option) any later version.
00013 
00014   This library is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00017   See the GNU Lesser General Public License for more details:
00018   http://www.gnu.org/copyleft/lesser.html
00019 
00020   You should have received a copy of the GNU Lesser General Public License
00021   along with this library/program; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00023 
00024   Turku PET Centre hereby disclaims all copyright interest in the program.
00025   Juhani Knuuti
00026   Director, Professor
00027   Turku PET Centre, Turku, Finland, http://www.turkupetcentre.fi/
00028 
00029   Modification history:
00030   2007-05-15 Vesa Oikonen
00031     First created.
00032   2010-04-25 VO
00033     Added csv2dft().
00034   2011-02-17 VO
00035     Added csv2dft_a() and csv2dft_b().
00036 
00037   
00038 
******************************************************************************/
 #ifndef _CSV_H
#define _CSV_H
/*****************************************************************************/

 /*****************************************************************************/
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
#include <math.h>
/*****************************************************************************/
 /*****************************************************************************/

/*****************************************************************************/
 enum {CSV_OK, CSV_ERROR, CSV_CANNOTOPEN, CSV_INVALIDFORMAT, CSV_TOOBIG,
     CSV_OUTOFMEMORY, CSV_NOTABLE
     };
/*****************************************************************************/
int CSV_TEST;
 /*****************************************************************************/

 /*****************************************************************************/
 typedef struct {
   int row;
   int col;
   char *content;
 } CSV_item;
 typedef struct {
   CSV_item *c;
  int nr;
  int row_nr;
  int col_nr;
   char separator;
 } CSV;
 /*****************************************************************************/
 
 /*****************************************************************************/
extern void csvInit(CSV *csv);
extern void csvEmpty(CSV *csv);
extern int csvRead(CSV *csv, char *fname);

 /*****************************************************************************/
 
/*****************************************************************************/
 #endif